<template>
    <div>
        <el-card class="!border-none" shadow="never">
			<el-page-header :content="title" @back="$router.back()" />
		</el-card>
        <el-card class="mt-4 !border-none" :header="subTitle" shadow="never">
			<el-table size="large" v-loading="pager.loading" :data="pager.lists">
				<el-table-column label="序号" type="index" :index="indexAdd" prop="order_id" min-width="90" />
                <el-table-column label="激励金额（元）" prop="account_name" min-width="120" />
                <el-table-column label="平台服务费金额（元）" prop="account_name" min-width="180" />
                <el-table-column label="交易流水号" prop="account_name" min-width="180">
                    <template #default="{ row }">
                        <el-link type="primary"  v-perms="['user.money/moneyLog']">
                            <router-link :to="{ path: getRoutePath('user.money/moneyLog'), query: { sn: row.account } }" >{{ row.account }}</router-link>
                        </el-link>
					</template>
                </el-table-column>
                <el-table-column label="渠道费单号" prop="account_name" min-width="180" >
                    <template #default="{ row }">
                        <el-link type="primary"  v-perms="['setting.pay.payConfig/commissionOrderlists']">
							<router-link :to="{ path: getRoutePath('setting.pay.payConfig/commissionOrderlists'), query: { sn: row.account } }" >{{ row.account }}</router-link>
                        </el-link>
					</template>
                </el-table-column>
                <el-table-column label="渠道姓名" prop="account_name" min-width="120" />
			</el-table>
			<div class="flex justify-end mt-4">
				<pagination v-model="pager" @change="getLists" />
			</div>
		</el-card>
    </div>
</template>
<script setup lang="ts">
import { accountList, setStatus } from '@/api/finance';
import { usePaging } from '@/hooks/usePaging';
import {getRoutePath } from '@/router'

const title = ref('2024年10月')
const subTitle = ref('金额共计：10,000.00元')

const { pager, getLists, resetPage, resetParams } = usePaging({
    fetchFun: accountList
})

 // 切页序号变化
 const indexAdd = (index: number) => {
    const page = pager.page // 当前页码
    const pagesize = pager.size // 每页条数
    return index + 1 + (page - 1) * pagesize
}
getLists()


</script>